package com.Java.train.member.controller;

import com.Java.train.common.context.LoginMemberContext;
import com.Java.train.common.req.MemberTicketReq;
import com.Java.train.common.response.CommonResp;
import com.Java.train.member.domain.DTO.TicketDTO;
import com.Java.train.member.req.TicketQueryReq;
import com.Java.train.common.response.PageResp;
import com.Java.train.member.service.TicketService;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotBlank;

/**
* @author luomoxingchen
* @since 2024-10-08
*/
@RestController
@RequestMapping("/ticket")
public class TicketController {
    private static final Logger LOG = LoggerFactory.getLogger(TicketController.class);
    @Autowired
    private TicketService ticketService;

    @GetMapping("/query-list")
    @ApiOperation("Ticket查询全部")
    public CommonResp<PageResp<TicketDTO>> queryList(@Valid TicketQueryReq ticketQueryReq){
        ticketQueryReq.setMemberId(LoginMemberContext.getId());
        PageResp<TicketDTO> list = ticketService.queryList(ticketQueryReq);
        return new CommonResp<>(list);
    }

}
